package com.atguigu.lease.web.app;

import com.atguigu.lease.model.enums.LeaseStatus;
import org.springframework.context.annotation.Configuration;
import org.springframework.core.convert.converter.Converter;
import org.springframework.format.FormatterRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

import java.util.Arrays;

@Configuration
public class WebConfig implements WebMvcConfigurer {
    @Override
    public void addFormatters(FormatterRegistry registry) {
        // 注册String到LeaseStatus的转换器
        registry.addConverter(new StringToLeaseStatusConverter());
    }
}

